/***************************************************************
*  Copyright (c) 2007 by GroupMe! Team (www.groupme.net)
*  All rights reserved.
*
*  This file is part of the GroupMe! Project. Source code of 
*  this project is closed and redistribution of this code is
*  prohibited. 
*  
*  Contact: http://www.groupme.net
*
*  This copyright notice MUST APPEAR in all copies of the file!
***************************************************************/
package net.groupme.game;

import java.util.Date;

import net.groupme.model.Group;
import net.groupme.model.User;

/**
 * created on Feb 29, 2008
 * 
 * This class represents a GroupMe! Game with its players, their groups, etc. Usage: This class
 * should be used when games that are already stored in the database should be accessed. E.g.
 * when instantiating this class then all values are read from the database and stored
 * in local variables. Setter methods are not reflected into the database.
 * 
 * @author Fabian Abel, <a href="mailto:abel@l3s.de">abel@l3s.de</a>
 * @author last edited by: $Author: fabian $
 * 
 * @version $Revision: 1.1 $ $Date: 2008-02-29 15:01:28 $
 */
public class GroupMeGameDAO extends GroupMeGame{
	
	private int overallScore = 0;
	private User creator = null;
	private Group creatorsGroup = null;
	private User opponent = null;
	private Group opponentsGroup = null;
	private String gametopic = null;
	private Date creationTime = null;
	private long id;

	/**
	 * Creates a new GroupMeGameDAO instance.
	 * @param overallScore
	 * @param creator
	 * @param creatorsGroup
	 * @param opponent
	 * @param opponentsGroup
	 * @param username
	 * @param gametopic
	 * @param creationTime
	 * @param id 
	 */
	public GroupMeGameDAO(long id, String gametopic, User creator, User opponent, 
			Group creatorsGroup, Group opponentsGroup, int overallScore,   
			 Date creationTime) {
		this.overallScore = overallScore;
		this.creator = creator;
		this.creatorsGroup = creatorsGroup;
		this.opponent = opponent;
		this.opponentsGroup = opponentsGroup;
		this.gametopic = gametopic;
		this.creationTime = creationTime;
		this.id = id;
	}

	/* (non-Javadoc)
	 * @see net.groupme.game.GroupMeGame#getOverallScore()
	 */
	@Override
	public int getOverallScore() {
		return this.overallScore;
	}

	/**
	 * This method returns the creator of a GroupMeGameDAO object.
	 * @return the creator
	 */
	@Override
	public User getCreator() {
		return creator;
	}


	/**
	 * This method returns the creatorsGroup of a GroupMeGameDAO object.
	 * @return the creatorsGroup
	 */
	@Override
	public Group getCreatorsGroup() {
		return creatorsGroup;
	}

	/**
	 * This method sets the creatorsGroup of a GroupMeGameDAO object.
	 * @param creatorsGroup the creatorsGroup to set
	 */
	@Override
	public void setCreatorsGroup(Group creatorsGroup) {
		this.creatorsGroup = creatorsGroup;
	}

	/**
	 * This method returns the opponent of a GroupMeGameDAO object.
	 * @return the opponent
	 */
	@Override
	public User getOpponent() {
		return opponent;
	}

	/**
	 * This method sets the opponent of a GroupMeGameDAO object.
	 * @param opponent the opponent to set
	 */
	@Override
	public void setOpponent(User opponent) {
		this.opponent = opponent;
	}

	/**
	 * This method returns the opponentsGroup of a GroupMeGameDAO object.
	 * @return the opponentsGroup
	 */
	@Override
	public Group getOpponentsGroup() {
		return opponentsGroup;
	}

	/**
	 * This method sets the opponentsGroup of a GroupMeGameDAO object.
	 * @param opponentsGroup the opponentsGroup to set
	 */
	@Override
	public void setOpponentsGroup(Group opponentsGroup) {
		this.opponentsGroup = opponentsGroup;
	}

	/**
	 * This method returns the gametopic of a GroupMeGameDAO object.
	 * @return the gametopic
	 */
	@Override
	public String getGametopic() {
		return gametopic;
	}


	/**
	 * This method returns the creationTime of a GroupMeGameDAO object.
	 * @return the creationTime
	 */
	@Override
	public Date getCreationTime() {
		return creationTime;
	}


	/**
	 * This method returns the id of a GroupMeGameDAO object.
	 * @return the id
	 */
	public long getId() {
		return id;
	}


}
